<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active{
            border: 1px solid red;
            width: 100px;
            height: 100px;
        }
        .error{
            background-color: orange;
        }
        [v-cloak] {
            display: none;
        }
    </style>
</head>
<body>
    <h2>Vue模板语法</h2>
        <div id="app">
           <h3>3.7、分支循环结构</h3>
           <div v-if="score>=90">优秀</div>
           <div v-else-if="score<90&&score>=80">良好</div>
           <div v-else-if="score<80&&score>60">一般</div>
           <div v-else>比较差</div>
           
           <div v-show='flag'>测试v-show</div>
           <button @click="handle">点击</button>
        </div>
</body>
<script src="./js/vue.js"></script>
<script>
    /*
        总结：
            1、分支结构
                        v-if
                        v-else
                        v-else-if
                        v-show原理：控制元素样式是否显示 display:none
    */
    var vm = new Vue({
        el: '#app',
        data: {
           score: 99,
           flag: false
        },
        methods:{
            handle:function(){
                //控制 样式的切换
                this.flag = !this.flag 
            }
        }
    })
</script>
</html>